define [ 'fizz' ], (fizz) ->
  class extends fizz.Model
  
    url : 'rest/login',
    
    defaults :
      # Login
      login : '',
      # Password
      password : ''
      # Authorities
      authorities : []
      
    validate : (attrs) ->
      errors = [];
      unless attrs.login?.length
        errors.push {attr: 'login', message: 'login.validation.emptyLogin'}
      unless attrs.password?.length
        errors.push {attr: 'password', message: 'login.validation.emptyPassword'}
      if errors.length
        return errors
      null
    
    toString : () ->
      @get 'login'
    